﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Code.Models
{
    public enum Salt
    {
        /// <summary>
        /// 普通
        /// </summary>
        Generic,
        /// <summary>
        /// 密钥
        /// </summary>
        Keys,
        /// <summary>
        /// 密码
        /// </summary>
        Password,
    }

    public static class SaltEx
    {
        public static string GetMd5Salt(this Salt salt)
        {
            switch (salt)
            { 
                case Salt.Generic:
                    return "638f73d5bc18ae00bfea5688a7196ea6";
                case Salt.Keys:
                    return "7b1987e040ffd6a8712bd46ac1ce7652";
                case Salt.Password:
                    return "88cf82735388873ce206ec5138cadce4";
                default:
                    throw new ArgumentOutOfRangeException();
            }
        }

        public static NameValueItem<string, string> GetDesSalt(this Salt salt)
        { 
            var item=new NameValueItem<string,string>();
            switch (salt)
            { 
                case Salt.Generic:
                    item.Key = "6e4b3d24b135edf0621de544175766ab";
                    item.Value = "+CE05BD70D9=";
                    break;
                case Salt.Keys:
                    item.Key = "7b72b3d4f64c526fea3866596f116c40";
                    item.Value = "+MtE3BB3C9C=";
                    break;
                case Salt.Password:
                    item.Key = "8390c6eecb2bb7f98e6054c706e30d2c";
                    item.Value = "+M746BE3CD0=";
                    break;
                default:
                    throw new ArgumentOutOfRangeException();
            }
            return item;
        }
    }
}
